package extendS;
abstract class Animal{
    public String name;
    public int age;
    abstract  void eat();
    abstract  void hair();
    public void fun(){
        System.out.println("睡觉");
    }
}
class cat extends Animal{

    @Override
    void eat() {
        System.out.println("吃猫粮");
    }

    @Override
    void hair() {
        System.out.println("猫咪的白发");
    }
    public static void fun3(){
        System.out.println("静态方法");
    }

}


public class Demo3 {
    public static void main(String[] args) {
        //发生向上转型
        Animal animal=new cat();
        animal.eat();
        animal.hair();
        animal.fun();
    }
}
